<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>Document</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#box{
				font-size: 40px;
			}
		</style>
	</head>

	<body>
		<div id="box">
			123
			<a href="#" class="aaa">321</a>
		</div>
		<script type="text/javascript">
			var phoneWidth = parseInt(window.screen.width);
			var phoneHeight = parseInt(window.screen.height);
			var phoneScale = phoneWidth / 750;  /*除以的值按手机的物理分辨率*/
			//获取head标签
			var $head = document.getElementsByTagName("head")[0];	
			var ua = navigator.userAgent;
			if(/Android (\d+\.\d+)/.test(ua)) {
				var version = parseFloat(RegExp.$1);
				// andriod 2.3
				if(version > 2.3) {
					$head.innerHTML+=('<meta name="viewport" content="width=device-width,initial-scale=' + phoneScale + ',minimum-scale=' + phoneScale + ',maximum-scale=' + phoneScale + ',user-scalable=no">');
					// andriod 2.3以上
				} else {
					$head.innerHTML+=('<meta name="viewport" content="width=device-width,user-scalable=no">');
				}
				// 其他系统
			} else {
				$head.innerHTML+=('<meta name="viewport" content="width=device-width, initial-scale=' + phoneScale + ',minimum-scale=' + phoneScale + ',maximum-scale =' + phoneScale + ',user-scalable=no,">');
			}
		</script>
	</body>

</html>